package com.ttbj.api.salesman;

import java.util.List;

import com.ttbj.api.dto.Page;
import com.ttbj.api.dto.Salesman2;
import com.ttbj.api.dto.SalesmanDto;
import com.ttbj.api.exception.BusinessException;



public interface SalesmanService {
	
	/**
	 * 后台登录
	 * @param username 用户名
	 * @param password 密码
	 * @return 用户详细信息
	 */
	public SalesmanDto login(String userName, String password) throws BusinessException;
	
	/**
	 * 通过用户名查询角色名称
	 * @param userName
	 * @return
	 * @throws BusinessException
	 */
	public SalesmanDto findRoleNameByName(String userName) throws BusinessException;
	
	/**
	 * 获取全部的用户
	 * @param page
	 * @param salesmanDto
	 * @return
	 */
	public List<SalesmanDto> findAllSalesmanByPage(Page page, SalesmanDto salesmanDto) throws BusinessException;
	
	/**
	 * 获取全部用户的总数
	 * @param salesmanDto
	 * @return
	 */
	public Integer findAllSalesmanByPageCount(SalesmanDto salesmanDto) throws BusinessException;
	
	/**
	 * 
	 * @param id
	 * @return
	 * @throws BusinessException
	 */
	public SalesmanDto querySalesmanById(Long id) throws BusinessException;
	
	/**
	 * 通过id删除用户，软删除
	 * @throws BusinessException
	 */
	public void deleSalesmanById(Long salesmanId, Integer isDel) throws BusinessException;
	
	/**更新用户信息
	 * @param salesmanDto
	 * @throws BusinessException
	 */
	public void editSalesmanInfo(SalesmanDto salesmanDto) throws BusinessException;
	
	/**
	 * 增加用户信息
	 * @param salesmanDto
	 * @throws BusinessException
	 */
	public void addSalesman(SalesmanDto salesmanDto) throws BusinessException;
	
	/**
	 * 通过用户名查询是否已经存在
	 * @return
	 * @throws BusinessException
	 */
	public int findSalesmanByName(String salesmanName) throws BusinessException;
	
	/**
	 * 修改用户密码
	 * @param inputSalesmanPwd 用户输入的密码
	 * @param oldSalesmanPwd 用户id
	 * @param newSalesmanPwd 用户输入的新密码
	 * @param salesmanName 用户名
	 * @throws BusinessException
	 */
	public void editSalesmanPwd(String inputSalesmanPwd, String oldSalesmanPwd, String salesmanName, Long salesmanId, String newSalesmanPwd) throws BusinessException;
	
	/**
     * 查询某一段id内的用户名，用于设置密码
     * @param sId 开始id
     * @param eId 结束id
     * @return
     */
	public List<Salesman2> findIdAndNameById(Long sId, Long eId);
	
	/**
	 * 查询未删除的开单人员的id，名字和分站点名(条件是：1未删除的，2必须是开单人员)
	 * @return
	 * @throws BusinessException
	 */
	public List<SalesmanDto> findSalesmanIdNameCompany() throws BusinessException;
}
